package com.sunnfun.provider;

import com.sunnfun.RpcApplication;
import com.sunnfun.registry.LocalRegistry;
import com.sunnfun.server.HttpServer;
import com.sunnfun.server.NettyHttpServer;
import com.sunnfun.service.UserService;

/**
 * 简易服务提供者示例
 */
public class EasyProviderExample {

    public static void main(String[] args) {

        RpcApplication.init();

        //注册服务
        LocalRegistry.register(UserService.class.getName(), UserServiceImpl.class);

        // 启动HTTP服务器
        HttpServer server = new NettyHttpServer();
        server.doStart(RpcApplication.getRpcConfig().getServerPort());
    }
}
